home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / FILE_DRO / STARTER_.C
C/C++ Source or Header  |  1992-02-15  |  2KB  |  61 lines

  1. #include "FD Interface.h"
  2.  
  3. /*****
  4.  * This is the module's main entrypoint.
  5.  *****/
  6. Boolean ModuleMain( short message, ModuleDataRec *moduleData)
  7. {
  8.     switch (message)
  9.     {
  10.         case eStartup    :
  11.             // The application just started
  12.             break;
  13.             
  14.         case eSFInitialize    :
  15.             // The SFGetFile is about to be brought up - you can install your own at this point
  16.             // if you want to.
  17.             // If the user chooses a file, you will receive one each of eValidate and eProcessFile
  18.             // messages.  If s/he chooses a folder, you will receive an eValidate and eProcessFile
  19.             // message for each file in the folder, and each file in each folder on down the line.
  20.             // NOTE: you only get one of these for each time the SFGetFile dialog comes up.  If 
  21.             // you want to initialize something before each file, do it in the eProcessFile case.
  22.             break;
  23.                 
  24.         case eAEInitialize    :
  25.             // An 'odoc' AppleEvent has been received - you are about to be flooded with 
  26.             // eValidateFile and eProcessFile messages (a set for each file you need to process)
  27.             // NOTE, you only get one of these for the whole batch of files.  If you want to
  28.             // initialize something before each file, do it in the eProcessFile case.
  29.             break;
  30.              
  31.         case eValidateFile    :
  32.             // return TRUE if theFile in moduleData is one that you want to process, FALSE otherwise
  33.             break;
  34.             
  35.         case eProcessFile    :
  36.             // Do your stuff - theFile in moduleData is the file you need to process
  37.             break;
  38.             
  39.         case eDispose        :
  40.             // If you allocated any storage in eSFInitialize or eAEInitialize, dispose of it here.
  41.             break;
  42.         
  43.         case eDoAboutBox    :
  44.             // Give yourself some credit.
  45.             break;
  46.         
  47.         case eQuitting        :
  48.             // The application is about to quit, save anything that needs to be saved.
  49.             break;
  50.     }
  51.     
  52.     return TRUE;    // this is actually ignored
  53. }
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.